import { uniqueId } from 'lodash';
import { IResponseData } from '@/typings/request';
import { ITodoItem } from '@/typings/todo';

export function getTodoList(): IResponseData<ITodoItem[]> {
  const id = uniqueId('todo_');
  return {
    code: 0,
    msg: '查询成功',
    data: [
      {
        id,
        text: '喝水',
        status: 'Wait',
      },
    ],
  };
}

export function getTodoListByAxios(): Promise<ITodoItem[]> {
  return new Promise((resolve) => {
    const id = uniqueId('todo_');
    const data = [
      {
        id,
        text: '喝水',
        status: 'Wait',
      },
    ];
    resolve(data);
  });
}
